<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>详情页</title>
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.6/dist/css/layui.css">
</head>
<body>


<div class="layui-row">
    <div class="layui-col-xs6">
        <div class="grid-demo grid-demo-bg1">
            <blockquote class="layui-elem-quote"><img src="{$One->images}"></blockquote>

            <div class="grid-demo grid-demo-bg1">
                <blockquote class="layui-elem-quote">{$One->s_day}</blockquote>
                <blockquote class="layui-elem-quote layui-quote-nm">
                    {$One->s_content}
                    <br>——大飞
                    {if($res != null)}
                    <span class="dian" style="color:red;">已点赞</span>

                    {else/}
                    <span class="dian" style="color:red;">点赞</span>
                    {/if}
                </blockquote>
            </div>
        </div>
    </div>
    <!--    排行榜-->
    <div class="layui-col-xs6">
        <div class="grid-demo">


        </div>
    </div>
</div>


</body>
</html>

<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
    $(function () {
        $('.dian').click(function () {
            let id="{$One->id}";
            let _this = $(this);
                $.ajax({
                    url:"{:url('test512/sign/diannum')}",
                    data:{id:id},
                    success:function (res) {
                        if (res.code==400){

                            _this.text('已点赞');
                        }
                        if (res.code==200)
                        {

                            _this.text('已点赞');

                        }
                    }
                })
        })
    })
</script>

